import { DatePicker } from 'view-ui-plus';
import { defineComponent } from 'vue';

export default defineComponent({
  props: {
    modelValue: {
      type: Date,
      dafault: null,
    },
  },
  emits: ['update:modelValue', 'change'],
  setup(props, { emit, slots }) {
    const onOnChange = (value) => {
      emit('update:modelValue', value);
      emit('change');
    };
    return () => {
      return (
        <DatePicker
          model-value={props.modelValue}
          {...props}
          onOnChange={onOnChange}
          style={{ width: '100%' }}
        />
      );
    };
  },
});
